﻿<!DOCTYPE html>
<!--[if IE 7]>
<html class="ie ie7" lang="zh-CN">
<![endif]-->
<!--[if IE 8]>
<html class="ie ie8" lang="zh-CN">
<![endif]-->
<!--[if !(IE 7) | !(IE 8) ]><!-->
<html lang="zh-CN">
<!--<![endif]-->
<head>




<meta charset="UTF-8">
<title>迷宫 | 默笙</title>
<meta name="description" content="想玩玩益智小游戏？现实君精心制作的小游戏“迷宫”一定符合你的要求！" />
<meta name="keywords" content="迷宫, 小工具, " />

<link href="css/style.css" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="css/navbar-fixed-top.css" rel="stylesheet">
<!-- Bootstrap Select Style -->
<link href="css/bootstrap-select.min.css" rel="stylesheet">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
	<script src="js/html5shiv.js"></script>
	<script src="js/respond.min.js"></script>
<![endif]-->
<link rel="stylesheet" href="css/style_1.css">
<script src="js/jquery.js"></script>
<script src="js/jquery.hotkey.js"></script>
</head>
<div id="circle"></div><div id="circle1"></div>
<body>

<!-- Fixed navbar -->
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
	<div class="container">
		<div class="navbar-header">
			<button type="button" class="navbar-toggle" data-toggle="collapse"
					data-target="#example-navbar-collapse">
				<span class="sr-only">切换导航</span>
				<span class="icon-bar"></span>
				<span class="icon-bar"></span>
				<span class="icon-bar"></span>
			</button>
			<a class="navbar-brand" href="http://tool.uixsj.cn/">工具箱</a>
		</div>
		<div class="navbar-collapse collapse" id="example-navbar-collapse">
			<ul class="nav navbar-nav">
				<li class="active"><a href="#">迷宫</a></li>
				
				<li><a href="https://www.iamy.vip" title="小Y资源网" target="_blank">小Y资源网</a></li>
				
			</ul>
			<ul class="nav navbar-nav navbar-right">
				<li><a href="http://tecms.net/" title="默笙官网" target="_blank">返回默笙官网</a></li>
			</ul>
		</div>
	</div>
</nav>

<div class="container">


<h1 class="title">迷宫</h1>
<div class="centerd">
<p>规则：从左上角出发，终点为右下角红旗处。</p>
<div id="mg" class="mg centerd"></div>
<br />
<p>提示：您可以使用键盘上的上丶下丶左丶右方向键控制迷宫中笑脸的移动。</p>

<strong>设置：</strong>
<p><input type="checkbox" onclick="mark(1, this);" id="mark1" /> <label for="mark1">将走过的格子用红色标出</label></p>

<form class="form-inline">
	<div class="form-group">
		宽：<input type="text" class="form-control" id="mg_width" value="20" size="4" maxlength="2" onkeypress="return isNumber(event)" />
	</div>
	<div class="form-group">
		高：<input type="text" class="form-control" id="mg_height" value="20" size="4" maxlength="2" onkeypress="return isNumber(event)" />
	</div>
	<button type="button" class="btn btn-default" onclick="new_mg();">生成新迷宫</button>
</form>

</div>

</div>
<div id="footer">
	<div class="container">
		<p class="text-center text-muted credit">Copyright &copy; 2017-2018 <a href="http://uixsj.cn/" title="现实君博客" target="_blank">默笙</a> </p>
		<p class="text-center text-muted credit"><a href="http://www.miibeian.gov.cn/" rel="external nofollow" title="备案查询" target="_blank">请自行修改备案号</a></p>
			</div>
</div>

<!-- Bootstrap core JavaScript -->
<!-- ================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
<script src="js/bootstrap-select.js"></script>
<script src="js/bootstrap-select.min.js"></script>
<script src="js/function.js"></script>
<script src="js/script.js"></script>


<script>
$(window).load(function() {
	$("#circle").fadeOut(500);
	$("#circle1").fadeOut(700);
});
</script>

<script>
function new_mg() {
	var w = parseInt(document.getElementById("mg_width").value) || 20,
		h = parseInt(document.getElementById("mg_height").value) || 20;
	mg.set({width: w, height: h}).create().show();
	document.getElementById("mg_width").value = w;
	document.getElementById("mg_height").value = h;
	count();
}

function count() {
	$.get("stat/count.py", {
			r: Math.random()
		}, function (r) {
			r = r.replace(/[\r\n\s]/g, "");
			if (r.match(/^\d+$/))
				$("#count").html(r);
		});
}

function mark(h, ob) {
	mg.me.setMark(h, ob.checked);
}

var mg = new MG("mg");
new_mg();
</script>
</body>
</html>
